package main

import (
	"knowledge-go/cpt/c_000_com"
	"log"
	"sync"
)

func main() {
	obPool := sync.Pool{
		New: func() interface{} {
			return &d13_myObject{}
		},
	}

	for i := 0; i < 5; i++ {
		o1 := obPool.Get().(*d13_myObject)
		log.Println("i", c_000_com.GetStructAddress(o1))

		// 使用完将对象放回池中
		obPool.Put(o1)
	}
}

type d13_myObject struct {
}
